package com.lc.protocol;

/**
 * Created by zhyioo on 2017/6/13.
 */

public class TransmitInvoker implements IInteractiveTrans {

    protected IInteractiveTrans _activeTrans = null;

    public void setTrans(IInteractiveTrans dev) {
        _activeTrans = dev;
    }

    @Override
    public boolean Write(byte[] data, int datalen) {
        if (_activeTrans == null)
            return false;
        return _activeTrans.Write(data, datalen);
    }

    @Override
    public boolean Read(byte[] data, int[] datalen) {
        if (_activeTrans == null)
            return false;
        return _activeTrans.Read(data, datalen);
    }
}
